import { reactive, FunctionalComponent, CSSProperties } from 'vue';
import ch_ZN from './assets/ch_ZN.json';import en from './assets/en.json';
const L:{[x:string]:typeof ch_ZN} = { ch_ZN, en },defLang=localStorage.getItem('_lang')??'ch_ZN',
s=reactive({_:"ch_ZN"});let o=true;
const Lang:FunctionalComponent<CSSProperties&{s?:LANGUAGES}>=(_,{attrs})=>{
  if(o){ s._=attrs.s||defLang as any;o=false; }
  return (<select onChange={({target})=>
      {let v=target[target.selectedIndex].value;s._=v;localStorage.setItem('_lang',v);}}value={s._}>
      <option value='en'>english</option>
      <option value='ch_ZN'>中文</option>
    </select>)
}
export {s,L,Lang};
type LANGUAGES="ch_ZN"|"en"